Ext.define('Seq.data.proxy.Paging', {
    extend: 'Seq.data.proxy.API',
    alias: 'proxy.paging',

    updateExtraParams(newExtraParams, oldExtraParams) {
        // 重置参数，必须翻页
        this.pageReset = !Ext.Object.equals(newExtraParams, oldExtraParams);
    },

    reader: {
        type: 'json',
        rootProperty: 'data.content',
        totalProperty: 'data.totalElements',
        transform: {
            fn(data) {
                if (false == data.success) { // 服务器报错时，显示消息
                    Seq.Msg.error('服务器内部错误：<br/><br/>' + data.message);
                    return [];
                }
                return data;
            },
            scope: this
        }
    }

});